home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / DEV / I-Z / ResExpress 1.0.1.sea / ResExpress 1.0.1 ƒ / ResX DevKit / Think C / Resx Utils.h next >
C/C++ Source or Header  |  1991-07-06  |  5KB  |  123 lines

  1. extern pascal void CenterWindow ();
  2. extern pascal void GetCenterPoint ();
  3. extern pascal void MoveBWindow ();
  4. extern pascal char ShortFName ();
  5. extern pascal char TrackRect ();
  6.  
  7. extern pascal char OKCancel ();  
  8. extern pascal void OKAlert ();
  9. extern pascal short YesNoCancel ();
  10. extern pascal int SelectFile ();
  11.  
  12. extern pascal Handle SuperNewHandle ();
  13. extern pascal void SuperHLock ();
  14. extern pascal void SuperHUnLock ();
  15. extern pascal void SuperDisposHandle ();
  16.  
  17. /*---------------------- Documentation of ResX Utils.h -------------------*/
  18. /*
  19. ResX Toolbox 
  20. ResX Utils is a library to be used for ResX externals and views. 
  21. It can only be used with ResX and any attempt to use it with another 
  22. project may be very hazardous to your health because it relies on the 
  23. presents of ResX to work. 
  24.  
  25. PROCEDURE CenterWindow (theWindow: WindowPtr);
  26. PROCEDURE GetCenterPoint (var thePoint: Point);
  27. PROCEDURE MoveBWindow (theWindow: WindowPtr; PrevWindowRect: Rect; var windFlag: Boolean);
  28.  
  29. FUNCTION ShortFName (LongName: Str255): Str255;
  30.  
  31. PROCEDURE GetDirInfo (vRefNum: Integer; vName: StringPtr; var wdDirID: Longint);
  32. FUNCTION TrackRect (theRect: Rect): Boolean;
  33.  
  34.  
  35.  
  36. Internal Alerts - 
  37.     The following Alerts allow direct access to the Alerts internal to ResX.  When a  
  38.      message or question is passed in, the Alert resources inside of ResX are used.   
  39.     This simplifies writing externals for ResX by leaps and bounds since the  
  40.     developer does not need to program for these common PROCEDUREs. 
  41.  
  42. FUNCTION OKCancel (Message: Str255): boolean;  TRUE if OK is clicked, FALSE if Cancel is clicked 
  43. PROCEDURE OKAlert (Message: Str255);
  44. FUNCTION YesNoCancel (Question: Str255): integer;  Yes=1, No=0, Cancel=-1 
  45.  
  46.  
  47.  
  48.  
  49. FUNCTION SelectFile: integer;
  50. SelectFile - 
  51.     This FUNCTION checks to see if a file is opened within ResX.  If only one file is opened,  
  52.     it's fileID will be returned.  If two files are opened, a dialog will appear and ask to select 
  53.     file.  The fileID of the file selected will be returned.  If the user cancels from the dialog, 
  54.     a zero will be returned.  If no files are opened, a -1 will be returned. 
  55.      
  56.     The resource to the dialog exists inside of ResX. 
  57.  
  58.     Result Codes:   
  59.                 -1: No file open. 
  60.                  0: Cancel was selected. 
  61.                 >0: fileID of the file selected. 
  62.  
  63.  
  64. FUNCTION TrapAvailable (theTrap: Integer): Boolean;
  65. TrapAvailable - 
  66.     Determines if a toolbox trap is available.  theTrap is the trap address to test. 
  67.     Example: 
  68.         if TrapAvailable(_OSDispatch) then ..... 
  69.  
  70.  
  71.  
  72. Super Memory Manager 
  73.  
  74. The Super Memory Manager is the best of the standard memory routines and the 
  75. Temporary memory routines.  It tests to see if the Temporary Memory Routines 
  76. exists and uses it if there is more memory available in the free space than in the  
  77. current heap.  If the blockSize requested is not available, it returns 90% of the 
  78. maximum available memory that can be obtained from either the current heap or 
  79. the free space heap, whichever is greater. 
  80.  
  81. HType is used by the Super Memory Manager to determine what type of handle was 
  82. created.  HType must NOT be altered at any time.  It is necessary to dispose of a 
  83. SuperHandle properly. 
  84.  
  85.  
  86.  
  87. FUNCTION SuperNewHandle (blockSize: Size; var HType: Boolean; var resultCode: OSErr): Handle;
  88. SuperNewHandle -  
  89.         blockSize    -    requested amount of memory to create a handle for.  If the requested amount 
  90.                         is not available, 90% of the available memory is returned. 
  91.         HType        -    returns the type of handle that was created.  True if Temporary, False if Standard. 
  92.                               Do not alter HType!  Alway use it to pass into Lock,Unlock and Dispose PROCEDUREs. 
  93.         resultCode-     the standard MemError result. 
  94.         RETURNS    -    a standard Handle. 
  95.  
  96.         If blockSize requested is not available, 90% of the maximum available memory is used. 
  97.         Use SizeOf(myHandle) to determine the size of the handle if needed. 
  98.  
  99.  
  100.     
  101. PROCEDURE SuperHLock (theHandle: Handle; HType: Boolean; var resultCode: OSErr);
  102. SuperHLock -  
  103.         theHandle    -    the Super handle to lock 
  104.         HType        -    the type of handle provided by SuperNewHandle. 
  105.         resultCode-     the standard MemError result. 
  106.  
  107.     
  108. PROCEDURE SuperHUnLock (theHandle: Handle; HType: Boolean; var resultCode: OSErr);
  109. SuperHUnLock -  
  110.         theHandle    -    the Super handle to UNlock 
  111.         HType        -    the type of handle provided by SuperNewHandle. 
  112.         resultCode-     the standard MemError result. 
  113.  
  114.     
  115. PROCEDURE SuperDisposHandle (theHandle: Handle; HType: Boolean; var resultCode: OSErr);
  116. SuperDisposHandle -  
  117.         theHandle    -    the Super handle to Dispose of. 
  118.         HType        -    the type of handle provided by SuperNewHandle. 
  119.         resultCode-     the standard MemError result. 
  120.  
  121. */
  122.  
  123.